<!--
 * Date: 2018年01月25日 16:17:35
 * LastEditors  : lvyou
 * LastEditTime : 2020年01月03日 13:55:23
 * FilePath: \youlinweb-master\src\components\allhot-header-indextopic.vue
 * copyright(c) 2019-2025 版权为浙江双城网络科技集团有限公司所有，违者必究。
 -->
<template>
  <div class="hot-header" @click="godetail($event,topicindex,commentindex,tabId)">
     <div class="pendant-container">
      <img class="avatar" v-lazy="avatarimg" />
      <img :src="pendantPicUrl"  class="pendant" v-if="pendantType!=0&&pendantPicUrl">
      <img src="https://youlingqinius.wonderlandnet.cn/youlin-shengdan@2x.png"  class="pendant" v-else-if="pendantType==1">
      <img src="https://youlingqinius.wonderlandnet.cn/youlin-yuandan@2x.png"  class="pendant" v-else-if="pendantType==2">
      <img src="https://youlingqinius.wonderlandnet.cn/youlin-chunjie@2x.png"  class="pendant" v-else-if="pendantType==3">
      <img src="https://youlingqinius.wonderlandnet.cn/youlin-yuanxiao@2x.png"  class="pendant" v-else-if="pendantType==4">
      <img src="~img/vip.png"  class="vipimg" v-else-if="userType==2">
      <img src="~img/daren.png"  class="vipimg v-h" v-else-if="isTalent==1">
     </div>
    <div class="header-right">
      <div class="nameleft">
        <span class="name">{{nickname}}</span>
        <span class="hot-shuoshuo-time" v-if="type==1">{{saytime}}</span>
        <span class="hot-discuss-time" v-if="type==0">{{topictime}}</span>
      </div>
      <div class="discusstime">
        <span class="hot-discuss-time" v-if="type==0&&floor!=null">{{floor}}楼</span>
        <div class="hot-shuoshuo" v-if="type==1">
          <span class="yl-map" style="font-size: 0.26rem;margin-right: 0.1rem">  </span>
          <span>{{place}}</span>
        </div>
      </div>
    </div>
  </div>
</template>
<script >
  export default{
    data (){
      return {
    
      }
    },
  props:['type','avatarimg','nickname','topictime','commentindex','topicindex','place','saytime','floor','tabId',"userType",'isTalent','pendantType','pendantPicUrl'],
  methods:{
    godetail(event,topicindex,commentindex,tabId){
      this.$emit("topiccommentdetail",{event:event,topicindex:topicindex,commentindex:commentindex,tabId:tabId})
    
    }
  }

  }
</script>
<style lang="less" scoped>
  .hot-header{
    display: flex;
    position: relative;
    align-items: center;
    margin: 0 0.3rem;
    background: #ffffff;
    padding: 0.3rem 0 0 0;
    width: 6.9rem;
    .pendant{
      width: 100%;
      height: 100%;
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
    }
    .pendant-container{
      width: 0.9rem;
      position: relative;
      height: 0.9rem;
    }
  }
  .avatar{
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 0.33rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  .header-right{
    margin-left: 0.2rem;
    width: 6.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .nameleft{
    display: flex;
  }
  .name{
    padding-right: 0.1rem;
    font-size: 0.28rem;
    color: #3A3A3A;
    font-weight: bold;
    font-family: PingFangSC-Medium, sans-serif;
  }
  .discusstime{
    display: inline-block;
  }
  .hot-discuss-time{
    line-height: 0.4rem;
    font-family: PingFangSC-Regular, sans-serif;
    font-size: 0.22rem;
    color: #999999;
  }
  .hot-shuoshuo-time{
    font-family: PingFangSC-Regular, sans-serif;
    font-size: 0.22rem;
    color: #999999;
  }
  .hot-shuoshuo{
    font-size: 0.24rem;
    color: #666666;
    display: flex;
    align-items: center;
    max-width: 200px;
  }
  .vipimg{
    width: 0.24rem;
    height: 0.24rem;
    position: absolute;
  }
</style>
